<header class="am-topbar am-topbar-inverse admin-header">
    <div class="am-topbar-brand">
        <strong><a href="/user/Index/index">学生在线报名系统--学生端</a></strong>
    </div>

    <button class="am-topbar-btn am-topbar-toggle am-btn am-btn-sm am-btn-success am-show-sm-only" data-am-collapse="{target: '#topbar-collapse'}"><span class="am-sr-only">导航切换</span> <span class="am-icon-bars"></span></button>

    <div class="am-collapse am-topbar-collapse" id="topbar-collapse">

        <ul class="am-nav am-nav-pills am-topbar-nav am-topbar-right admin-header-list">
            <li class="am-dropdown" data-am-dropdown>
                <a class="am-dropdown-toggle" data-am-dropdown-toggle href="javascript:;">
                    <span class="am-icon-user"></span> {$name}
                </a>
            </li>
            <li>
                <a href="javascript:;" id="loginOut"><span class="am-icon-power-off"></span> 注销</a>
            </li>
        </ul>
    </div>
</header>
<script>
    $(function(){
        //注销按钮监听点击事件
        $("#loginOut").on("click",function(){
            $.ajax({
                url:"/user/Login/loginOut",
                type:"get",
                success:function (res) {
                    console.log(res);
                    if (res.code == 1) {
                        layer.msg('注销成功', {time: 1000});
                        setTimeout(function () {
                            window.location.href = '/user/Login/index';
                        }, 1000);
                    }
                }
            });
        });
    });
</script>